#ifndef _BIN_H_
#define _BIN_H_

#include <vector>
using namespace std;

#include "GUIBase.h"
#include "Part.h"
#include "Enums.h"
#include <qpoint.h>

class GUIFeeder;

#define PARTS_PER_BIN 20

/**
 * \enum	BinColor
 *
 * \brief	Values that represent BinColor.
 */

enum BinColor
{
	BinColor_White,
	BinColor_Purple,
	BinColor_Yellow,
	BinColor_Orange,
	BinColor_Green,
	BinColor_Pink,
	BinColor_Red,
	BinColor_Blue,
};

class Bin : public GUIBase
{
	Q_OBJECT

private:
	vector<Part*> parts;
	GUIFeeder *currentFeeder;

public:
	Bin(int startX, int startY, BinColor binColor = BinColor_White);
	Bin(int startX, int startY, PartType, BinColor binColor = BinColor_White);

	PartType GetPartType();
	int GetPartCount();
	void AddPartToBin(Part* part);
	Part* TakeTopPartOut();
	void FillBinWithNewParts(PartType partType);
	void EmptyBin();
	vector<Part*> GetParts();
	void SetFeeder(GUIFeeder* feeder);
	GUIFeeder* GetFeeder();

public slots:
	void beganAscending(qreal newScale, qreal scaleSpeed);
	void beganDescending(qreal newScale, qreal scaleSpeed);
};

#endif
